//////////////////////////////////////////////////////////////////////////
// q3dSegment - segment in Quebra3D
// By Antonio Miranda - June 2014
//////////////////////////////////////////////////////////////////////////

#include <math.h>

#include "q3dSegment.h"
#include "geom/curves/curvefactory.h" 

//
//////////////////////////////////////////////////////////////////////////
q3dSegment::q3dSegment ()
{
  m_curve = NULL;
  m_adjSurf[0] = NULL;
  m_adjSurf[1] = NULL;
  m_adjVextex[0] = NULL;
  m_adjVextex[1] = NULL;
}

//
//////////////////////////////////////////////////////////////////////////
q3dSegment::~q3dSegment(void)
{
}


//
//////////////////////////////////////////////////////////////////////////
void q3dSegment::createCurve( vector <Point3D> &pts )
{
  // create polyline
  m_curve = CurveFactory::create(Curve::POLYLINE);

  m_curve->beginAddPoint(0.0, 0.0, 0.0);
  for (size_t i = 0; i < pts.size(); ++i)
    m_curve->addPoint(pts[i][0], pts[i][1], pts[i][2]);
  m_curve->endAddPoint();
}
